<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./template/LayoutPadrao.xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.org/ui"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns="http://www.w3.org/1999/xhtml">

    <ui:define name="centro">
        <h:form id="frm1">
            <p:panelGrid columns="2">
                <f:facet name="header">Consultar Inscrição - No de Inscrição</f:facet>
                <p:outputLabel value="Num. Inscrição" for="numInscricao" style="font-size: 16px"/>
                <p:inputText value="#{consultaInscricaoBean.numInscricao}" id="numInscricao"
                             required="true"
                             />
                <f:facet name="footer">
                    <p:commandLink id="basic" value="Consultar"
                                   oncomplete="dlg1.show();"
                                   update="@form"
                                   action="#{consultaInscricaoBean.consultar}">

                    </p:commandLink>
                </f:facet>
            </p:panelGrid>
            <p:dialog id="basicDialog" header="Consulta Inscrição - #{consultaInscricaoBean.participante.nome}" 
                      widgetVar="dlg1" 
                      resizable="false"
                      width="800"
                      >
                <p:dataTable value="#{consultaInscricaoBean.participante}" 
                             var="participante">
                    <p:column style="width: 25px; text-align: center">
                        <f:facet name="header">
                            Num. Inscrição
                        </f:facet>
                        <h:outputText value="#{participante.numInscricao}"/>
                    </p:column>
                    <p:column>
                        <f:facet name="header">
                            Nome
                        </f:facet>                  
                        <p:inplace editor="true">
                            <p:inputText value="#{participante.nome}"/>
                        </p:inplace>
                    </p:column>
                    <p:column>
                        <f:facet name="header">
                            CPF
                        </f:facet>                  
                        <p:inplace editor="true">
                            <p:inputText value="#{participante.cpf}" />
                        </p:inplace>
                    </p:column>
                    <p:column>
                    <f:facet name="header">
                        Situação
                    </f:facet>                  
                   
                        <h:outputLabel value="Pendente" rendered="#{participante.situacao == '0'}"/>
                        <h:outputLabel value="OK" rendered="#{participante.situacao == '1'}"/>
                   
                </p:column>

                </p:dataTable>
            </p:dialog>
            <p:messages closable="true" id="msg"/>
        </h:form>
        <h:form id="frm2">
            <p:panelGrid columns="2">
                <f:facet name="header">Consultar Inscrição - CPF</f:facet>
                <p:outputLabel value="CPF" for="cpf" style="font-size: 16px"/>
                <p:inputText value="#{consultaInscricaoBean.cpf}" id="cpf"
                             required="true"
                             />
                <f:facet name="footer">
                    <p:commandLink id="basic" value="Consultar"
                                   oncomplete="dlg2.show();"
                                   update="frm2"
                                   action="#{consultaInscricaoBean.consultarPorCPF}">

                    </p:commandLink>
                </f:facet>
            </p:panelGrid>
            <p:dialog id="basicDialog" header="Consulta Inscrição - #{consultaInscricaoBean.participante.nome}" 
                      widgetVar="dlg2" 
                      resizable="false"
                      width="800"
                      >
                <p:dataTable value="#{consultaInscricaoBean.participante}" 
                             var="participante">
                    <p:column style="width: 25px; text-align: center">
                        <f:facet name="header">
                            Num. Inscrição
                        </f:facet>
                        <h:outputText value="#{participante.numInscricao}"/>
                    </p:column>
                    <p:column>
                        <f:facet name="header">
                            Nome
                        </f:facet>                  
                        <p:inplace editor="true">
                            <p:inputText value="#{participante.nome}"/>
                        </p:inplace>
                    </p:column>
                    <p:column>
                        <f:facet name="header">
                            CPF
                        </f:facet>                  
                        <p:inplace editor="true">
                            <p:inputText value="#{participante.cpf}" />
                        </p:inplace>
                    </p:column>
                    <p:column>
                    <f:facet name="header">
                        Situação
                    </f:facet>                  
                   
                        <h:outputLabel value="Pendente" rendered="#{participante.situacao == '0'}"/>
                        <h:outputLabel value="OK" rendered="#{participante.situacao == '1'}"/>
                   
                </p:column>

                </p:dataTable>
            </p:dialog>
            <p:messages closable="true" id="msg"/>
        </h:form>
    </ui:define>

</ui:composition>
